package com.orange.core.pojo.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Getter
public enum EFlowBusinessType implements IDict {

    FIRST_REGISTER(1, "首次注册赠送"),

    CREDIT_ORDER(2, "积分商城换礼"),

    PARKING_FEE(3, "停车缴费抵扣"),

    UPLOAD_RECEIPT(4, "上传消费小票"),

    CREDIT_ORDER_REFUND(5, "积分订单退款"),

    ACTIVITY_ORDER_PAYMENT(6, "活动订单收款"),

    ACTIVITY_ORDER_REFUND(7, "活动订单退款")
    ;

    private final int value;
    private final String label;

    public static String getName(int value) {
        for (EFlowBusinessType type : EFlowBusinessType.values()) {
            if (type.getValue() == value) {
                return type.getLabel();
            }
        }
        throw new IllegalArgumentException("流水类型不存在：" + value);
    }
}
